package com.suneast.suneaststore.modules.personal.order.adapter;

import android.support.v7.widget.RecyclerView;

import java.util.List;

abstract class BaseAdapter<VH extends RecyclerView.ViewHolder, E> extends RecyclerView.Adapter<VH> {
    protected List<E> list = null;

    public void setList(List<E> list) {
        this.list = list;
        notifyDataSetChanged();
    }

    public List<E> getList() {
        return list;
    }

    @Override
    public int getItemCount() {
        return list == null ? 0 : list.size();
    }
}
